﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ABELGX
{
    /// <summary>
    /// UserControlPad.xaml 的交互逻辑
    /// </summary>
    public partial class UserControlPad : UserControl
    {
        public UserControlPad()
        {
            InitializeComponent();
        }
        public void SetInfo(string title, RegisterBool up, RegisterBool down, RegisterBool left, RegisterBool right)
        {
            LabelTitle.Content = title;
            if(up != null)
            {
                new ButtonVM(ButtonUp, ButtonVMType.Press, up, up);
            }
            else
            {
                ButtonUp.IsEnabled = false;
            }
            if (down != null)
            {
                new ButtonVM(ButtonDown, ButtonVMType.Press, down, down);
            }
            else
            {
                ButtonDown.IsEnabled = false;
            }
            if (left != null)
            {
                new ButtonVM(ButtonLeft, ButtonVMType.Press, left, left);
            }
            else
            {
                ButtonLeft.IsEnabled = false;
            }
            if (right != null)
            {
                new ButtonVM(ButtonRight, ButtonVMType.Press, right, right);
            }
            else
            {
                ButtonRight.IsEnabled = false;
            }
        }
    }
}
